<html>
  <head>
    <title>汇编在线编程演示</title>
    <link type="text/css" th:href="@{/style.css}" rel="stylesheet"></link>
    <style type="text/css" media="screen">
    body {
        overflow: hidden;
    }
    #editor {
        margin: 0;
        position: absolute;
        top: 300px;
        bottom: 0;
        left: 0px;
        right: 0;
    }
  </style>
  
  </head>

  <body>
    <div>
    	<label>nasm结果:</label>
    	<span th:text="${compile}"></span>
    </div>
    <div>
    	<label>ld结果:</label>
    	<span th:text="${ld}"></span>
    </div>
    <div>
    	<label>输出:</label>
    	<span th:text="${output}"></span>
    </div>
    <div>
    	<label>运行时错误:</label>
    	<span th:text="${error}"></span>
    </div>
    <div>
    	<label>其他错误:</label>
    	<span th:text="${genericerror}"></span>
    </div>
  
    <h3>输入汇编代码, 目前只支持NASM for Linux 64bit:</h3>
    <form method="POST" th:action="@{/nasm}">
      <input class="submit" type="submit" value="运行"></input><br/>
      <textarea id="hiddenSrc" name="汇编码" style="visibility:hidden" th:text="${initcode}" cols="80" rows="60"></textarea>
      <pre id="editor" th:text="${initcode}"></pre>
    </form>

    <script src="src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
    var editor = ace.edit("editor");
    editor.setTheme("ace/theme/twilight");
    editor.session.setMode("ace/mode/assembly_x86");
    editor.on("change", function() {
    	document.getElementsByTagName('textarea')[0].value = editor.getValue();
    });
</script>
  </body>
</html>